<?php

/***  DOCUMENTATION LAYER

Baffle Class Debugging Test

Last Update: Aug 2007
	
DESCRIPTION
	brief description of script here
	
NOTES
		
***/

$_tx0 = microtime();

// Test Name
$test_name = 'test ceo input filter';

// Include Files
require_once('../php_ceo/ext/input/form.class.php');

// Variable Declarations
#$foo = 'bar';

// Simple Test of Class
if ( 1 )
{
  $CeoForm = new CeoForm($debug=1, 'CeoFormInputFilterTest');
  CeoForm::print_d('testing static CeoForm::sanitize_input with no TAG or ATT whitelist');
  $TEST = array
  (
    'some script: <script>script is bad mkay</script>',
    'this should be ok.',
    'bold: <b title="ok" style="no_good">bold!</b>',
    'a link: <a href="/">a link</a>',
  );
  foreach ( $TEST as $str )
  {
    $esc = htmlspecialchars($str);
    $san = CeoForm::staticInputFilter($str, $TAG=array(), $ATT=array(), 1);
    $san = htmlspecialchars($san);
    print "$esc -> $san <br />";
  }
  
  $CeoForm->print_d('testing filter_input method');
  foreach ( $TEST as $str )
  {
    $esc = htmlspecialchars($str);
    $san = $CeoForm->filter_input($str);
    $san = htmlspecialchars($san);
    print "$esc -> $san <br />";
  }
  
   $CeoForm->print_d($CeoForm->print_r($CeoForm->InputFilter));
}


// Footer
$_txn = microtime();
$stx = number_format(((substr($_txn,0,9)) + (substr($_txn,-10)) - (substr($_tx0,0,9)) - (substr($_tx0,-10))),4); 
echo "<h6>test '$test_name' complete in $stx s</h6>";

?>
